var webpack = require('webpack');
var path = require('path');

var srcBase = './src/js';
var distBase = './dist/js';

module.exports = {
  entry: {
    demo: srcBase + '/main.js',
    login: srcBase + '/login.js',
  },

  output: {
    path: distBase,
    filename: '[name].js',
    chunkFilename: '[id].js'
  },

  module: {
    loaders: [
      { test: /\.vue$/, loader: 'vue' },
      {
        // use babel-loader for *.js files
        test: /\.js$/,
        loader: 'babel',
        // important: exclude files in node_modules
        // otherwise it's going to be really slow!
        exclude: /node_modules/
      },
      { test: /\.css$/, loader: 'style!css' },
      { test: /\.html$/, loader: 'html' }
    ]
  },

  babel: {
    presets: ['es2015'],
    plugins: ['transform-runtime']
  },

  resolve: {
         alias: {
             'vue': 'vue/dist/vue.js'
         }
     },

  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ]
};
